package com.xcc.annotation.tx.mysql;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

@Service
public class UserService {

    @Autowired
    UserDao userDao;

    @Transactional
    public void insert(int num , int age) {
        String name = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
        userDao.insert(name, num, age);
        int i = 1 / 0;
    }

}
